package com.cnyz.base;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

//存放基本类型
@Data
@NoArgsConstructor
@ApiModel(description = "基本常量类")
public class BaseEntity implements Serializable {

    @ApiModelProperty(value = "主键")
    private Long id;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "创建人")
    private Long createBy;

    @ApiModelProperty(value = "更新人")
    private Long updateBy;

    @ApiModelProperty(value = "评论")
    private String remark;

    @ApiModelProperty(value = "创建人")
    private String creator;

    @ApiModelProperty(value = "更新人")
    private String updater;

    @ApiModelProperty(value = "")
    private Map<String, Objects> params;

    public BaseEntity(Long id) {
        this.id = id;
    }

    public Map<String, Objects> getParams() {
        if(this.params == null){
            this.params = new HashMap<>();
        }
        return this.params;
    }

}
